<?php

namespace Drupal\shushengyuan\Schemas;

use Drupal\ssy_index_window\Entity\SsyIndexWindow;

class WindowItem extends AbstractBaseModel {

  protected function getEntityType() {
    return 'ssy_index_window';
  }

  protected function setValue() {
    if ($this->entity instanceof SsyIndexWindow) {
      $imgs = $this->getImgs($this->wrapper->field_images);
      $value = [
        'url' => $this->entity->xcxurl,
        'src' => $imgs[1][0],
        'imgs' => $this->getImgs($this->wrapper->field_images),
      ];
      $this->merge($value);
    }
  }

}
